package per.hnvcam.searchext.data.model;

import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.MapUtils;

import java.util.HashMap;
import java.util.Map;

public class HedgeConfiguration {
   @SuppressWarnings("unchecked")
   private Map<String, DoubleValue> functionMeters = MapUtils.lazyMap(new HashMap<String, DoubleValue>(),
      FactoryUtils.instantiateFactory(DoubleValue.class));
   private double alpha;
   private double beta;

   public HedgeConfiguration() {
   }

   public void setFMValue(String item, double value) {
      functionMeters.put(item, new DoubleValue(value));
   }

   public double getFMValue(String item) {
      return functionMeters.get(item).getValue();
   }

   public double getAlpha() {
      return alpha;
   }

   public void setAlpha(double alpha) {
      this.alpha = alpha;
   }

   public double getBeta() {
      return beta;
   }

   public void setBeta(double beta) {
      this.beta = beta;
   }

   public Map<String, DoubleValue> getFunctionMeters() {
      return functionMeters;
   }

   public void setFunctionMeters(Map<String, DoubleValue> functionMeters) {
      this.functionMeters = functionMeters;
   }
}
